// 简化版本的Vue配置
const IS_PROD = ['production'].includes(process.env.NODE_ENV);
const devServerPort = 8081;
const TransformPages = require('uni-read-pages');
const { webpack } = new TransformPages();
const path = require('path');

module.exports = {
  lintOnSave: !IS_PROD,
  productionSourceMap: false,
  devServer: {
    port: devServerPort,
    open: false,
    overlay: {
      warnings: false,
      errors: true,
    }
  },
  transpileDependencies: ['@dcloudio/uni-ui'],
  configureWebpack: {
    plugins: [
      new webpack.DefinePlugin({
        ROUTES: webpack.DefinePlugin.runtimeValue(() => {
          const tfPages = new TransformPages({
            includes: ['path', 'name', 'aliasPath', 'meta'],
          });
          return JSON.stringify(tfPages.routes);
        }, true),
      }),
    ],
    resolve: {
      alias: {
        '@': path.resolve(__dirname, './src')
      }
    }
  },
}; 